package main

import "fmt"

type Money struct {
	name string
	salary int
}

func (m Money) show()  {
	fmt.Println(m.name,"薪水",m.salary)
}
//引用类型
func (m *Money) Double() {
	m.salary = 2 * m.salary
}
func main() {
	a := new(Money)
	a.name = "张三"
	a.salary = 100

	fmt.Println(a)
	a.show()

	//给张三薪水翻倍
	a.Double()
	fmt.Println(a)
}